﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace HZYProject.Domain
{
    public class Student
    {
        /// <summary>
        /// 微信OpenID
        /// </summary>
        public string WXOpenID { get; set; }

        /// <summary>
        /// 编号
        /// </summary>
        [Key]
        [Comment("编号")]
        public Guid StudentID { get; set; }

        /// <summary>
        /// 身份证号
        /// </summary>
        
        [StringLength(50)]
        public string IdNo { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        /// <remarks>
        /// 默认~+身份证后六位
        /// </remarks>
        [StringLength(50)]
        public string PassWord { get; set; }


        /// <summary>
        /// 所属院校编号
        /// </summary>
        public Guid CollegesId { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        [StringLength(50)]
        public string RealName { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [StringLength(50)]
        public string Sex { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [StringLength(50)]
        public string Mphone { get; set; }


        /// <summary>
        /// 邮箱
        /// </summary>
        [StringLength(50)]
        public string Email { get; set; }


        /// <summary>
        /// 创建时间
        /// </summary>
        [DataType(DataType.DateTime)]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public StuStatus Status { get; set; }

        /// <summary>
        /// 导航属性-所属班级
        /// </summary>
        public virtual ICollection<Class> Classes { get; set; }

        /// <summary>
        /// 导航属性--拥有的课程
        /// </summary>
        public virtual ICollection<Course> Courses { get; set; }
        /// <summary>
        /// 导航属性--拥有的考试
        /// </summary>
        public virtual ICollection<Result> Results { get; set; }

        /// <summary>
        /// 导航属性-所属院校
        /// </summary>
        public virtual Colleges Colleges { get; set; }

    }

    public enum StuStatus
    {
        [Display(Name = "正常")]
        Normal = 1,
        [Display(Name = "锁定")]
        Lock = 2,
        [Display(Name = "冻结")]
        Frozen = 3
    }
}
